package com.example.calculator_backend.pojo;

import java.math.BigDecimal;
import java.util.List;

/**
 * @description: 贷款计算结果
 * @author: hdr
 * @PACKAGE_NAME: com.example.calculator_backend.pojo
 * @DATE: 2025/8/11
 */
public class LoanResult {
    private BigDecimal totalRepayment;      // 总还款金额
    private BigDecimal totalInterest;       // 总利息
    private BigDecimal monthlyPayment;      // 第一月还款金额
    private List<PaymentDetail> schedule;   // 还款计划表

    // 构造函数
    public LoanResult() {}

    public LoanResult(BigDecimal totalRepayment, BigDecimal totalInterest, BigDecimal monthlyPayment, List<PaymentDetail> schedule) {
        this.totalRepayment = totalRepayment;
        this.totalInterest = totalInterest;
        this.monthlyPayment = monthlyPayment;
        this.schedule = schedule;
    }

    // Getter 和 Setter 方法
    public BigDecimal getTotalRepayment() {
        return totalRepayment;
    }

    public void setTotalRepayment(BigDecimal totalRepayment) {
        this.totalRepayment = totalRepayment;
    }

    public BigDecimal getTotalInterest() {
        return totalInterest;
    }

    public void setTotalInterest(BigDecimal totalInterest) {
        this.totalInterest = totalInterest;
    }

    public BigDecimal getMonthlyPayment() {
        return monthlyPayment;
    }

    public void setMonthlyPayment(BigDecimal monthlyPayment) {
        this.monthlyPayment = monthlyPayment;
    }

    public List<PaymentDetail> getSchedule() {
        return schedule;
    }

    public void setSchedule(List<PaymentDetail> schedule) {
        this.schedule = schedule;
    }

    @Override
    public String toString() {
        return "LoanResult{" +
                "totalRepayment=" + totalRepayment +
                ", totalInterest=" + totalInterest +
                ", monthlyPayment=" + monthlyPayment +
                ", schedule=" + schedule +
                '}';
    }
}
